﻿using System.ComponentModel.DataAnnotations;

namespace WenAntdUI.Settings;

public class Setting
{
    /// <summary>
    /// 名称
    /// </summary>
    [Key]
    [DisplayName("名称")]
    public string Name { get; set; } = "";

    /// <summary>
    /// 分组名称
    /// </summary>
    [DisplayName("分组")]
    public string? GroupName { get; set; }

    /// <summary>
    /// 显示名称
    /// </summary>
    [DisplayName("显示名称")]
    public string? DisplayName { get; set; }

    /// <summary>
    /// 注释
    /// </summary>
    [DisplayName("注释")]
    public string? Description { get; set; }

    /// <summary>
    /// 值
    /// </summary>
    [DisplayName("值")]
    public string? Value { get; set; }

    /// <summary>
    /// 类
    /// </summary>
    [DisplayName("类")]
    public string? Type { get; set; }

    /// <summary>
    /// 分类
    /// </summary>
    [DisplayName("分类")]
    public SettingTyp Typ { get; set; }
}

[Description("系统设置类型")]
public enum SettingTyp
{
    [Description("默认")]
    None = 0,
    [Description("字符串")]
    String = 1,
    [Description("Bool类型")]
    Bool = 2,
    [Description("下拉选项")]
    Down = 3,
    [Description("数字")]
    Number = 4,
    [Description("SqlServer")]
    SqlServer = 1001,
    [Description("Access")]
    Access = 1002,
    [Description("Sqlite")]
    Sqlite = 1003
}